package Demo;

/**
 * Created with IntelliJ IDEA.
 * Description:抽象类
 * User: LianBao
 * Date: 2024-03-05
 * Time: 15:53
 */
abstract class Shape {
    abstract void draw();
}

class Circle extends Shape {

    @Override
    void draw() {
        System.out.println("画圆圈");
    }
}

class Triangle extends Shape {

    @Override
    void draw() {
        System.out.println("画三角形");
    }
}

public class Test {

    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        Circle circle = new Circle();
        Triangle triangle = new Triangle();
        drawMap(circle);
        drawMap(triangle);
    }
}
